""" Get moments from data

"""
import pandas as pd
import sys
sys.path.append('./')

from src.run_scripts import utils

#%% COMPUTE THE MOMENTS -----------------------------------------------------------------
df_contracts = pd.read_csv('./data_py/processed/contracts_final.csv', index_col=[0])
df_state = pd.read_csv(
    './data_py/processed/states_month.csv',
    index_col=[0],
    parse_dates=['date']
)
df_state['2006'] = (df_state['date'].dt.year == 2006)

moments_agg = utils.get_aggregated_moments_from_data(df_contracts, df_state)

#%% COMPUTE THE MOMENTS -----------------------------------------------------------------
pd.Series(moments_agg).to_csv('./models/smm_input/moments_empirical.csv')
